package com.vca.common.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;

/**
 * @author chenbing
 * @date 2022/11/22   9:32
 */
@Data
public class PreOrderCommonVo {

    public static List<PreOrderCommonVo.PreOrderProductDetail> PreOrderProductDetail;
    @ApiModelProperty(value = "预下单类型（“shoppingCart”：购物车下单，“buyNow”：立即购买，”again“： 再次购买")
    @NotBlank(message = "预下单类型不能为空")
    private String preOrderType;

    @ApiModelProperty(value = "订单类型 0 = 课程 1= 套课 2=讲座 3=展览 4=商品")
    private Integer type;

    @ApiModelProperty(value = "课程/套课/讲座/展览详情")
    private CourseInfoDetail eventInfoDetail;

    @ApiModelProperty(value = "商品详情")
    private List<PreOrderProductDetail> productDetail;

    @ApiModelProperty(value = "购物车编号列表")
    private List<Long> cartIdList;

    @ApiModelProperty(value = "地址ID")
    private Integer addressId;

    @ApiModelProperty(value = "总数量")
    private Integer count = 1;

    @ApiModelProperty(value = "讲座/课程/套课/展览总价")
    private BigDecimal totalPriceCourse = BigDecimal.ZERO;

    @ApiModelProperty(value = "商品总价")
    private BigDecimal totalPriceShop = BigDecimal.ZERO;

    @ApiModelProperty(value = "总价")
    private BigDecimal totalPrice = BigDecimal.ZERO;

    @Data
    public static class PreOrderProductDetail{
        @ApiModelProperty(value = "商品ID")
        private Integer productId;

        @ApiModelProperty(value = "商品名称")
        private String name;

        @ApiModelProperty(value = "英文商品名称")
        private String nameEn;

        @ApiModelProperty(value = "面值（录入的商品非礼品卡时，不需要填写面值）")
        private BigDecimal faceValue;

        @ApiModelProperty(value = "商品简介")
        private String introduction;

        @ApiModelProperty(value = "英文商品简介")
        private String introductionEn;

        @ApiModelProperty(value = "商品属性ID")
        private Integer attrValueId;

        @ApiModelProperty(value = "商品图片")
        private String image;

        @ApiModelProperty(value = "sku")
        private String sku;

        @ApiModelProperty(value = "英文sku")
        private String skuEn;
        @ApiModelProperty(value = "商品价格")
        private BigDecimal price;

        @ApiModelProperty(value = "购买数量")
        private Integer buyNum;

        @ApiModelProperty(value = "重量")
        private BigDecimal weight;

        @ApiModelProperty(value = "体积")
        private BigDecimal volume;

        @ApiModelProperty(value = "ISBN编号")
        private String isbnCode;

        @ApiModelProperty(value = "商品类型")
        private String type;

        @ApiModelProperty(value = "英文商品类型")
        private String typeEn;

        @ApiModelProperty(value = "类型标签颜色")
        private String labelColor;

        @ApiModelProperty(value = "礼品卡编号")
        private String cardNo;
        @ApiModelProperty(value = "礼品卡编号多个")
        private List<String> cardNos;

        @ApiModelProperty(value = "选择使用范围 0=课程 1=讲座 2=展览")
        private Integer useAround;

        @ApiModelProperty(value = "使用类型 1=分类卡 2=课程卡/讲座卡/展览卡（取决于使用范围）")
        private Integer useType;

        @ApiModelProperty(value = "所属分类id / 课程id（id以“,”分割）")
        private String primaryKey;

        @ApiModelProperty(value = "有效期")
        private Integer endTime;

        @ApiModelProperty(value = "退款状态 0 未退款 1 申请中 2 已退款 （退款到账）3 退款中（管理员同意退款）")
        private Integer refundStatus;

        @ApiModelProperty(value = "状态")
        private String orderInfoStatus;

        @ApiModelProperty(value = "单个明细实际支付金额（使用礼品卡的时候，存储折扣后的金额；不是用的时候，就是单个明细的总金额）")
        private BigDecimal payPrice;

    }

    @Data
    public static class CourseInfoDetail{

        @ApiModelProperty(value = "课程/套课/讲座/展览名称")
        private String name;

        @ApiModelProperty(value = "英文课程/英文套课/英文讲座/英文展览名称")
        private String nameEn;

        @ApiModelProperty(value = "价格")
        private BigDecimal price;

        @ApiModelProperty(value = "购买数量")
        private Integer buyCount = 1;

        @ApiModelProperty(value = "课程/套课/讲座/展览ID")
        private Long mainId;

        @ApiModelProperty(value = "封面")
        private String coverImage;

        @Data
        public static class Scheduling{
            @ApiModelProperty(value = "课程ID")
            private Long courseId;

            @ApiModelProperty(value = "排课ID")
            private Long scheduleId;

            @ApiModelProperty(value = "课程名称")
            private String courseName;

            @ApiModelProperty(value = "英文课程名称")
            private String courseNameEn;

            @ApiModelProperty(value = "排期封面图")
            private String coverImage;

            @ApiModelProperty(value = "排课日期")
            private String schedulingDate;

            @ApiModelProperty(value = "排课当天开始时间")
            private String schedulingStartTime;

            @ApiModelProperty(value = "排课当天结束时间")
            private String schedulingEndTime;

            @ApiModelProperty(value = "上课语言")
            private String language;

            @ApiModelProperty(value = "英文上课语言")
            private String languageEn;

            @ApiModelProperty(value = "课程地址")
            private HashMap<String, Object> courseAddress;

            @ApiModelProperty(value = "英文课程地址")
            private HashMap<String, Object> courseAddressEn;

            @ApiModelProperty(value = "1 =待核销 2=待评价 3 交易完成 0=未支付")
            private Integer isWriteOff;

            @ApiModelProperty(value = "状态")
            private String orderInfoStatus;

            @ApiModelProperty(value = "单个明细实际支付金额（使用礼品卡的时候，存储折扣后的金额；不是用的时候，就是单个明细的总金额）")
            private BigDecimal payPrice;

            @ApiModelProperty(value = "观看平台")
            private String viewingPlatformName;

            @ApiModelProperty(value = "直播链接")
            private String liveBroadLink;
            @ApiModelProperty(value = "课程类型")
            private String typeName;

            @ApiModelProperty(value = "英文课程类型")
            private String typeNameEn;
        }

        @ApiModelProperty(value = "讲座类型 1=线下讲座 2=线上讲座")
        private Integer talkType;

        @ApiModelProperty(value = "课程排期")
        private List<Scheduling> schedulings;

        @ApiModelProperty(value = "展览开始日期")
        private String startTime;

        @ApiModelProperty(value = "展览结束日期")
        private String endTime;

        @ApiModelProperty(value = "课程类型")
        private String typeName;

        @ApiModelProperty(value = "英文课程类型")
        private String typeNameEn;

        @ApiModelProperty(value = "课程类型标签颜色")
        private String typeLabelColor;
    }
}
